package com.beecloud.microservice.user.web.controller;

import com.beecloud.microservice.user.domain.dto.*;
import com.beecloud.microservice.user.web.parameter.NotificationParam;
import com.beecloud.microservice.user.web.parameter.ResetPasswordParam;
import com.beecloud.microservice.user.web.parameter.UserRegisterParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.http.ResponseEntity;

import java.util.List;

public interface UserApi {


    @ApiOperation(value = "注册新用户")
    @ApiResponses({
            @ApiResponse(code = 200, response = UserDTO.class, message = "用户注册成功")
    })
    ResponseEntity<UserDTO> userRegister(@ApiParam(value = "用户注册信息", required = true) UserRegisterParam user);


    @ApiOperation(value = "用户详细信息")
    @ApiResponses({
            @ApiResponse(code = 200, response = UserDTO.class, message = "获取用户信息成.")
    })
    ResponseEntity<UserDTO> queryUserDetail(@ApiParam(value = "用户ID", required = true) String id);


    @ApiOperation(value = "分页获取用户信息。")
    @ApiResponses({
            @ApiResponse(code = 200, response = UserDTO.class, message = "分页获取用户信息成功", responseContainer = "List")
    })
    ResponseEntity<UserPageDTO> queryUsers(
            @ApiParam(value = "用户名称") String name,
            @ApiParam(value = "当前页数") int page,
            @ApiParam(value = "每页数量") int pageSize);

    @ApiOperation(value = "批量获取用户信息。")
    @ApiResponses({
            @ApiResponse(code = 200, response = UserDTO.class, message = "批量获取用户信息", responseContainer = "List")
    })
    ResponseEntity<List<UserDTO>> queryUsersByIds(
            @ApiParam(value = "用户id列表, 逗号分割。") String ids);

    @ApiOperation(value = "重置用户密码")
    @ApiResponses({
            @ApiResponse(code = 200, response = UserDTO.class, message = "重置用户密码成功")
    })
    ResponseEntity<UserDTO> resetPassword(@ApiParam(value = "用户ID", required = true) String id,
                          @ApiParam(value = "重置密码参数", required = true) ResetPasswordParam resetPasswordParam);


    @ApiOperation(value = "获取用户订单")
    @ApiResponses({
            @ApiResponse(code = 200, response = OrderDTO.class, message = "获取用户订单成功。", responseContainer = "List")
    })
    ResponseEntity<List<OrderDTO>> queryUserOrders(
            @ApiParam(value = "用户ID", required = true) String id,
            @ApiParam(value = "订单状态") String status,
            @ApiParam(value = "当前页码") int page,
            @ApiParam(value = "每页数量") int pageSize);


    @ApiOperation(value = "获取系统通知。")
    @ApiResponses({
            @ApiResponse(code = 200, response = NotificationDTO.class, message = "获取系统通知成功。", responseContainer = "List")
    })
    ResponseEntity<NotificationPageDTO> queryNotifications(
            @ApiParam(value = "用户ID", required = true) String id,
            @ApiParam(value = "通知状态：1未读, 2已读", allowableValues = "range[1, 2]" ) int status,
            @ApiParam(value = "当前页码") int page,
            @ApiParam(value = "每页数量") int pageSize);

    @ApiOperation(value = "新建系统通知。")
    @ApiResponses({
            @ApiResponse(code = 200, response = NotificationDTO.class, message = "创建系统通知成功。", responseContainer = "List")
    })
    ResponseEntity<NotificationDTO> createNotification(
            @ApiParam(value = "用户ID", required = true) String id,
            @ApiParam(value = "通知实体") NotificationParam notificationParam
    );



}
